
{extends file="../acp.html"}

{block name="title"}{$head_title}{/block}
{block name="content"}
<div class="t-detail-top">
	<div class="top-tit">
		当前用户状态：{$user_info.is_enable}
        <a type="button" class="btn" href="/AcpUser/set_user_title/user_id/{$user_info.user_id}" style="float:right;">分配头衔</a>
	</div>
</div>
<div class="t-detail-goods">
    <div class="t-detail-goods-tit mag">基本信息：</div>
    <div class="t-detail-goods-con t-buser">
    	<table class="wxtables tables-form">  
            <colgroup>  
                <col width="10%">  
                <col width="90%">   
            </colgroup>  
            <tbody>  
                 <!--<tr>
                    <td class="tables-form-title">头像：</td>
					<td><img src="{$user_info.headimgurl}" style="width:50px;"></td>
                </tr>-->
                <!--<tr>  -->
                    <!--<td class="tables-form-title">加盟商：</td>  -->
					<!--<td>{if $user_info.nickname}{$user_info.nickname}{else}&#45;&#45;{/if}</td>   -->
                <!--</tr> -->
                 <tr>
                     <td class="tables-form-title">昵称：</td>
                     <td>
                     {if $user_info.nickname}
                     <input  class="content nickname"name="nickname" disabled value="{$user_info.nickname}" />
                     <span class="btn btn-red edit">修改</span>
                     <div class="operate" style="display: none">
                         <span class="btn btn-blue cancel">取消</span>  <span class="btn btn-blue save" data-post_id="{$user_info.user_id}" data-content_type="normal">保存</span>
                     </div>
                     {else}--{/if}
                     </td>
                 </tr>

                <tr>
                    <td class="tables-form-title">性别：</td>
					<td>{if $user_info.sex == 1}男{else}女{/if}</td>
                </tr>

                 {if $user_info.is_selected != 1}
                 <tr>
                     <td class="tables-form-title">推荐优先级：</td>
                     <td>
                         {if $user_info.is_selected}
                         <input name="is_selected" class="content is_selected" disabled value="{$user_info.is_selected}" />
                         <span class="btn btn-red edit">修改</span>
                         <div class="operate" style="display: none">
                             <span class="btn btn-blue cancel">取消</span>  <span class="btn btn-blue save" data-post_id="{$user_info.user_id}" data-content_type="normal">保存</span>
                         </div>
                         {else}--{/if}
                     </td>
                 </tr>
                 {else}
                 {/if}

                 <tr>
                    <td class="tables-form-title">手机号：</td>  
					<td>{if $user_info.mobile}{$user_info.mobile}{else}--{/if}</td>
                </tr>
               <!-- <tr>
                    <td class="tables-form-title">邮箱：</td>  
					<td>{if $user_info.email}{$user_info.email}{else}&#45;&#45;{/if}</td>
                </tr>-->
                <tr>
                    <td class="tables-form-title">注册时间：</td>
                    <td>{if $user_info.reg_time}{$user_info.reg_time|date_format:"%Y-%m-%d %H:%M:%S"}{else}--{/if}</td>
                </tr>
                <tr>
                     <td class="tables-form-title">已有头衔：</td>
                     <td>{if $user_info.user_title_list}
                         {foreach from = $user_info.user_title_list item=this }
                         {$this.title_name},
                         {/foreach}
                         {else}--{/if}</td>
                </tr>
                <!--<tr>  -->
                    <!--<td class="tables-form-title">QQ：</td>  -->
                    <!--<td>{if $user_info.qq}{$user_info.qq}{else}&#45;&#45;{/if}</td>   -->
                <!--</tr>-->
                <!--<tr>  -->
                    <!--<td class="tables-form-title">用户类型：</td>  -->
                    <!--<td>{if $user_info.user_type}系统内用户{else}系统外用户{/if}</td>   -->
                <!--</tr>-->
                <!--<tr>  -->
                    <!--<td class="tables-form-title">门店编号：</td>  -->
                    <!--<td>{if $user_info.store_sn}{$user_info.store_sn}{else}&#45;&#45;{/if}</td>   -->
                <!--</tr>-->
                <!--<tr>  -->
                    <!--<td class="tables-form-title">大区：</td>  -->
                    <!--<td>{if $user_info.big_area_name}{$user_info.big_area_name}{else}&#45;&#45;{/if}</td>   -->
                <!--</tr>-->
               <!-- <tr>
                    <td class="tables-form-title">省市县：</td>  
                    <td>{if $user_info.area_string}{$user_info.area_string}{else}&#45;&#45;{/if}</td>
                </tr>-->
            </tbody>  
        </table>   
    </div>

<!--	<div class="t-detail-goods-tit mag">财务信息：</div>
    <div class="t-detail-goods-con t-buser">
    	<table class="wxtables tables-form">
            <colgroup>
                <col width="10%">
                <col width="90%">
            </colgroup>
            <tbody>
                <tr>
                    <td class="tables-form-title">用户等级：</td>
					<td>{if $user_info.rank_name}{$user_info.rank_name}{else}&#45;&#45;{/if}</td>
                </tr>
                <tr>
					<td class="tables-form-title">剩余{$SYSTEM_MONEY_NAME}：</td>
					<td>{$user_info.left_money}</td>
                </tr>
                &lt;!&ndash; <tr>
                    <td class="tables-form-title">已消费金额：</td>
					<td>{$user_info.consumed_money}</td>
                </tr> &ndash;&gt;
                <tr>
                    <td class="tables-form-title">积分余额：</td>
                    <td>{$user_info.left_integral}</td>
                </tr>
            </tbody>
        </table>
    </div>-->

	<!--<div class="t-detail-goods-tit mag">收货信息：</div>-->
    <!--<div class="t-detail-goods-con t-buser">-->
    	<!--<table class="wxtables tables-form">  -->
            <!--<colgroup>  -->
                <!--<col width="10%">-->
                <!--<col width="90%">-->
            <!--</colgroup>  -->
            <!--<tbody>  -->
                <!--<tr>  -->
                    <!--<td class="tables-form-title">收货地址：</td>  -->
					<!--<td>{$user_info.area_string}{$user_info.address}</td>   -->
                <!--</tr>  -->
            <!--</tbody>  -->
        <!--</table>   -->
    <!--</div>-->
</div>
{/block} 

{block name="js"}
{literal}

<script src="/Public/Plugins/layer/layer.js"></script>
<!--wangtao 2017.9.18 -strat-->

<script>
    $('.edit').on('click',function () {
        var _this = $(this);
        content = _this.siblings('.content').val();
        _this.hide();
        _this.siblings('.content').attr('disabled',false);
        _this.siblings('.operate').show();
    })

    $('.cancel').on('click',function () {
        var _this = $(this);
        _this.parent().siblings('.content').val(content);
        _this.parent().hide();
        _this.parent().siblings('.content').attr('disabled',true);
        _this.parent().siblings('.edit').show();
    })

    $('.save').on('click',function () {
        var user_id = $(this).attr('data-post_id');
        var is_selected = $(this).parent().siblings('.is_selected').val();
        var nickname = $(this).parent().siblings('.nickname').val();
        console.log(user_id);
        console.log(nickname);
        $.ajax({
            type:'post',
            url:'/AcpUser/edit_user_info',
            data:{user_id:user_id,nickname:nickname,is_selected:is_selected},
            success:function (data) {
                if(data.code == 1){
                    layer.msg(data.msg, {
                        icon:6,
                        time: 1000, //1s后自动关闭
                        end:function () {
                            location.reload();
                        }
                    });
                }else{
                    layer.msg(data.msg,{icon:5});
                }
            }
        })
    })

</script>

<!--wangtao 2017.9.18 -end-->

<style>
#jpops .fi-name{width:100px;}
#jpops .form-controls{margin-left:100px;}
</style>
{/literal} 
{/block}
{block name="css"}
<link rel="stylesheet" href="/Public/Css/acp/AcpOrder/order_detail.css" type="text/css" />
{/block} 
